package com.jian.java;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;

/**
 * @author Jiange
 * @create 2021-06-01-20:04
 */
@SpringBootApplication
@EnableHystrixDashboard
public class DashBorad {
    public static void main(String[] args) {
        SpringApplication.run(DashBorad.class);
    }
    @Bean
    public ServletRegistrationBean hystrixDashboard() {
        ServletRegistrationBean bean = new ServletRegistrationBean(new HystrixMetricsStreamServlet());
        bean.addUrlMappings("/actuator/hystrix.stream");
        return bean;
    }
}
